home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / TSMTE.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  3.5 KB  |  130 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        TSMTE.h
  3.  
  4.      Contains:    Text Services Managerfor TextEdit Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    ©1991-1997 Apple Technology, Inc. All rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __TSMTE__
  19. #define __TSMTE__
  20.  
  21. #ifndef __TEXTEDIT__
  22. #include <TextEdit.h>
  23. #endif
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27. #ifndef __APPLEEVENTS__
  28. #include <AppleEvents.h>
  29. #endif
  30. #ifndef __TEXTSERVICES__
  31. #include <TextServices.h>
  32. #endif
  33. /* #include <Gestalt.i>*/
  34.  
  35.  
  36.  
  37.  
  38. #if PRAGMA_ONCE
  39. #pragma once
  40. #endif
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45.  
  46. #if PRAGMA_IMPORT
  47. #pragma import on
  48. #endif
  49.  
  50. #if PRAGMA_STRUCT_ALIGN
  51.     #pragma options align=mac68k
  52. #elif PRAGMA_STRUCT_PACKPUSH
  53.     #pragma pack(push, 2)
  54. #elif PRAGMA_STRUCT_PACK
  55.     #pragma pack(2)
  56. #endif
  57.  
  58. /* signature, interface types*/
  59.  
  60. enum {
  61.     kTSMTESignature                = FOUR_CHAR_CODE('tmTE'),
  62.     kTSMTEInterfaceType            = FOUR_CHAR_CODE('tmTE'),
  63.     kTSMTEDialog                = FOUR_CHAR_CODE('tmDI')
  64. };
  65.  
  66.  
  67. /* update flag for TSMTERec*/
  68.  
  69. enum {
  70.     kTSMTEAutoScroll            = 1
  71. };
  72.  
  73.  
  74. /* callback procedure definitions*/
  75.  
  76. typedef CALLBACK_API( void , TSMTEPreUpdateProcPtr )(TEHandle textH, long refCon);
  77. typedef CALLBACK_API( void , TSMTEPostUpdateProcPtr )(TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon);
  78. typedef STACK_UPP_TYPE(TSMTEPreUpdateProcPtr)                     TSMTEPreUpdateUPP;
  79. typedef STACK_UPP_TYPE(TSMTEPostUpdateProcPtr)                     TSMTEPostUpdateUPP;
  80.  
  81.  
  82. /* data types*/
  83. struct TSMTERec {
  84.     TEHandle                         textH;
  85.     TSMTEPreUpdateUPP                 preUpdateProc;
  86.     TSMTEPostUpdateUPP                 postUpdateProc;
  87.     long                             updateFlag;
  88.     long                             refCon;
  89. };
  90. typedef struct TSMTERec TSMTERec;
  91.  
  92. typedef TSMTERec *                        TSMTERecPtr;
  93. typedef TSMTERecPtr *                    TSMTERecHandle;
  94. struct TSMDialogRecord {
  95.     DialogRecord                     fDialog;
  96.     TSMDocumentID                     fDocID;
  97.     TSMTERecHandle                     fTSMTERecH;
  98.     long                             fTSMTERsvd[3];                /* reserved*/
  99. };
  100. typedef struct TSMDialogRecord TSMDialogRecord;
  101.  
  102. typedef TSMDialogRecord *                TSMDialogPeek;
  103. enum { uppTSMTEPreUpdateProcInfo = 0x000003C0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes) */
  104. enum { uppTSMTEPostUpdateProcInfo = 0x000FFFC0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  105. #define NewTSMTEPreUpdateProc(userRoutine)                         (TSMTEPreUpdateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPreUpdateProcInfo, GetCurrentArchitecture())
  106. #define NewTSMTEPostUpdateProc(userRoutine)                     (TSMTEPostUpdateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTSMTEPostUpdateProcInfo, GetCurrentArchitecture())
  107. #define CallTSMTEPreUpdateProc(userRoutine, textH, refCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppTSMTEPreUpdateProcInfo, (textH), (refCon))
  108. #define CallTSMTEPostUpdateProc(userRoutine, textH, fixLen, inputAreaStart, inputAreaEnd, pinStart, pinEnd, refCon)  CALL_SEVEN_PARAMETER_UPP((userRoutine), uppTSMTEPostUpdateProcInfo, (textH), (fixLen), (inputAreaStart), (inputAreaEnd), (pinStart), (pinEnd), (refCon))
  109.  
  110. #if PRAGMA_STRUCT_ALIGN
  111.     #pragma options align=reset
  112. #elif PRAGMA_STRUCT_PACKPUSH
  113.     #pragma pack(pop)
  114. #elif PRAGMA_STRUCT_PACK
  115.     #pragma pack()
  116. #endif
  117.  
  118. #ifdef PRAGMA_IMPORT_OFF
  119. #pragma import off
  120. #elif PRAGMA_IMPORT
  121. #pragma import reset
  122. #endif
  123.  
  124. #ifdef __cplusplus
  125. }
  126. #endif
  127.  
  128. #endif /* __TSMTE__ */
  129.  
  130.